<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>密码登录</title>
    <link rel="stylesheet" href="./css/reset.css">
    <style>
        body {
            background-color: gainsboro;
        }

        #app {
            width: 300px;
            height: 200px;
            background-color: #fff;
            border-radius: 5px;
            margin: 100px auto;
            padding: 10px 20px;
        }

        h2 {
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 20px;
        }

        input {
            width: 260px;
            height: 40px;
            border-bottom: 1px solid gainsboro;
        }

        button {
            width: 260px;
            height: 30px;
            margin-top: 20px;
            border-radius: 20px;
            color: gray;
        }
    </style>
</head>

<body>
    <div id="app">
        <h2>密码登录</h2>
        <input type="text" placeholder="手机/用户名" v-model="text">
        <input type="password" placeholder="密码" v-model="pass">
        <button @click="login">登录</button>
    </div>
</body>

</html>
<script src="./js/vue-2.5.21.js"></script>
<script>
    let v = new Vue({
        el: '#app',
        data: {
            text: '',
            pass: '',
            tasklist: []
        },
        methods: {
            login() {
                this.tasklist.push({ username: this.text, pass: this.pass })
                this.text = ''
                this.pass = ''
                console.log(this.tasklist);
            }
        }
    })
</script>